<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    var a = [1,10,20,50]
    //1.
    console.log(Math.max(...a))
    //2.
    function max() {
      const nums = Array.from(arguments)
      let max = 0
      nums.forEach(n => {
        if (max < n) {
          max = n
        }
      })
      return max
    }
    console.log(max(20,30,4,2))
</script>
</html>
